const { validIncorrectParameter } = require('@utils/tools');

const { addrAddSchema, addrUpdateSchema } = require('./address.schema');

module.exports = {
  async validator(ctx, next) {
    const valid = validIncorrectParameter(addrAddSchema, ctx);

    !valid && (await next());
  },

  async validatorByUpdate(ctx, next) {
    const valid = validIncorrectParameter(addrUpdateSchema, ctx);

    !valid && (await next());
  },
};
